package com.example.mybatisplus.service.impl;

import com.example.mybatisplus.mapper.VisitInfoMapper;
import com.example.mybatisplus.model.domain.ConsultInfo;
import com.example.mybatisplus.mapper.ConsultInfoMapper;
import com.example.mybatisplus.model.domain.VisitInfo;
import com.example.mybatisplus.service.ConsultInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * ��ѯ��Ϣ�� 服务实现类
 * </p>
 *
 * @author lxp
 * @since 2023-10-16
 */
@Service
public class ConsultInfoServiceImpl extends ServiceImpl<ConsultInfoMapper, ConsultInfo> implements ConsultInfoService {

    @Autowired
    private ConsultInfoMapper consultInfoMapper;
    //获取全部数据通过页码等限制展示
    @Override
    public List<ConsultInfo> getAll(Long page,Long limit,ConsultInfo consultInfo) {
        List<ConsultInfo> consultInfos=consultInfoMapper.getAll(page,limit,consultInfo);
        return consultInfos;
    }
    //获取数据总数
    @Override
    public List<ConsultInfo> getTotal(ConsultInfo consultInfo) {
        List<ConsultInfo> consultInfos=consultInfoMapper.getTotal(consultInfo);
        return consultInfos;
    }

    @Override
    public ConsultInfo getAllById(Long consultId) {
        ConsultInfo  consultInfo=consultInfoMapper.getAllById(consultId);
        return consultInfo;
    }
    //进行假删除
    @Override
    public void deleteByConsultIds(List<Long> consultIds) {
        consultInfoMapper.deleteByConsultIds(consultIds);
    }

    @Override
    public void passByConsultId(Long consultId, Long type,Long status) {
        consultInfoMapper.passByConsultId(consultId,type,status);
    }

    //修改咨询信息
    @Override
    public void modifyConsult(ConsultInfo consultInfo) {
        consultInfoMapper.modifyConsult(consultInfo);
    }

    @Override
    public void modifyResult(ConsultInfo consultInfo) {
        consultInfoMapper.modifyResult(consultInfo);
    }
    //增加咨询信息
    @Override
    public void addConsult(ConsultInfo consultInfo) {
        consultInfoMapper.addCounsult(consultInfo);
    }

    @Override
    public List<ConsultInfo> getConsultByVisits(String visitId) {
        List<ConsultInfo> consultInfos=consultInfoMapper.getConsultByVisits(visitId);
        return consultInfos;
    }
}
